package com.gxuwz.eschool.fragment;

import android.content.Intent;
import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.TextView;

import com.gxuwz.eschool.AllApplicationActivity;
import com.gxuwz.eschool.BalanceActivity;
import com.gxuwz.eschool.BatheActivity;
import com.gxuwz.eschool.CardLossReportActivity;
import com.gxuwz.eschool.CardRechargeActivity;
import com.gxuwz.eschool.CardUnlockingActivity;
import com.gxuwz.eschool.DetailedQueryActivity;
import com.gxuwz.eschool.NewAnnouncementActivity;
import com.gxuwz.eschool.PaymentActivity;
import com.gxuwz.eschool.R;
import com.gxuwz.eschool.SchoolIntroductionActivity;
import com.gxuwz.eschool.UtilityBillPaymentActivity;
import com.gxuwz.eschool.WaterRechargeActivity;
import com.gxuwz.eschool.WaterRecordActivity;
//首页
public class HomeFragment extends Fragment {


    private TextView tv_payment;
    private ImageButton ib_payment;
    private TextView tv_school_introduction;
    private TextView tv_card_recharge;
    private ImageButton ib_card_recharge;
    private TextView tv_detailed;
    private TextView tv_card_loss_report;
    private TextView tv_card_unlocking;
    private TextView tv_bathe;
    private TextView tv_utility_bill_payment;
    private ImageButton ib_balance;
    private TextView tv_new_announcement;
    private TextView tv_water_records;
    private TextView tv_water_recharge;
    private TextView  tv_all_application;

    public HomeFragment() {
        // Required empty public constructor
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_home, container, false);
        tv_payment = view.findViewById(R.id.tv_payment);
        ib_payment = view.findViewById(R.id.ib_payment);
        tv_school_introduction = view.findViewById(R.id.tv_school_introduction);
        tv_card_recharge = view.findViewById(R.id.tv_card_recharge);
        ib_card_recharge = view.findViewById(R.id.ib_card_recharge);
        tv_detailed = view.findViewById(R.id.tv_detailed);
        tv_card_loss_report = view.findViewById(R.id.tv_card_loss_report);
        tv_card_unlocking = view.findViewById(R.id.tv_card_unlocking);
        tv_utility_bill_payment = view.findViewById(R.id.tv_utility_bill_payment);
        tv_bathe = view.findViewById(R.id.tv_bathe);
        ib_balance = view.findViewById(R.id.ib_balance);
        tv_new_announcement = view.findViewById(R.id.tv_new_announcement);
        tv_water_records = view.findViewById(R.id.tv_water_records);
        tv_water_recharge = view.findViewById(R.id.tv_water_recharge);
        tv_all_application = view.findViewById(R.id.tv_all_application);


        tv_payment.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(), PaymentActivity.class);
                startActivity(intent);
            }
        });
        ib_payment.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(),PaymentActivity.class);
                startActivity(intent);
            }
        });
        tv_school_introduction.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(), SchoolIntroductionActivity.class);
                startActivity(intent);
            }
        });
        tv_card_recharge.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(), CardRechargeActivity.class);
                startActivity(intent);
            }
        });
        ib_card_recharge.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(), CardRechargeActivity.class);
                startActivity(intent);
            }
        });
        tv_detailed.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(), DetailedQueryActivity.class);
                startActivity(intent);
            }
        });

        tv_card_loss_report.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(), CardLossReportActivity.class);
                startActivity(intent);
            }
        });
        tv_card_unlocking.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(), CardUnlockingActivity.class);
                startActivity(intent);
            }
        });
        tv_utility_bill_payment.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(), UtilityBillPaymentActivity.class);
                startActivity(intent);
            }
        });
        tv_bathe.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(), BatheActivity.class);
                startActivity(intent);
            }
        });
        ib_balance.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(), BalanceActivity.class);
                startActivity(intent);
            }
        });
        tv_new_announcement.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(), NewAnnouncementActivity.class);
                startActivity(intent);
            }
        });
        tv_water_records.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(), WaterRecordActivity.class);
                startActivity(intent);
            }
        });
        tv_water_recharge.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(), WaterRechargeActivity.class);
                startActivity(intent);
            }
        });
        tv_all_application.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(), AllApplicationActivity.class);
                startActivity(intent);
            }
        });
        return view;
    }
}